package com.cn.yugan.Engine.Http;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Rover on 2016/10/10 .
 * Email 357319517@qq.com
 * cookie获取类
 */
public class AddReqCookie {
    private static SharedPreferences sharedPreferences;

    /**
     * 登录所用的cookie
     * @param context
     * @return
     */
    public static String getLoginheader(Context context) {
        sharedPreferences = context.getSharedPreferences("Session", Context.MODE_PRIVATE);
        return sharedPreferences.getString("phpsessid", null);
    }

    /**
     * 一般情况下所需要的cookie
     * @param context
     * @return
     */
    public static String getNormalheader(Context context) {
        sharedPreferences = context.getSharedPreferences("Session", Context.MODE_PRIVATE);
        String reqc = sharedPreferences.getString("phpsessid", null) +";"+ sharedPreferences.getString("uid", null) +";"+ sharedPreferences.getString("intro", null) +";"+ sharedPreferences.getString("name", null) +";"+ sharedPreferences.getString("token", null) + ";"+sharedPreferences.getString("img", null) +";"+ sharedPreferences.getString("_gat", null) +";"+ sharedPreferences.getString("_ga", null)+";";
        return reqc;
    }
}
